package com.zlp.mall.portal.modules.oms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zlp.mall.portal.modules.oms.mapper.OrderItemMapper;
import com.zlp.mall.portal.modules.oms.model.OrderItem;
import com.zlp.mall.portal.modules.oms.service.OrderItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单中所包含的商品 服务实现类
 * </p>
 *
 * @author ZouLiPing
 * @since 2021-10-15
 */
@Service
@Slf4j(topic = "OrderItemServiceImpl")
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {

    @Override
    public List<OrderItem> getByOrderId(Long orderId) {

        log.info("getByOrderId.req orderId={}",orderId);
        LambdaQueryWrapper<OrderItem> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(OrderItem::getOrderId,orderId);
        return this.list(queryWrapper);
    }
}
